import React, { Component } from 'react'
import '../../styles/会员购/list.css'
import {nav} from '../../apis/home'
export default class MyList extends Component {
    constructor(props) {
        super(props)
        this.state = {
            arr: []
        }

    }

    async componentDidMount(){
        let res = await nav();
        this.setState({
            arr:res.list
        },()=>{
            // console.log(this.state.arr);
        })
        // console.log(res,this.state.arr);
    }
    render() {
        return (
            <div className='list'>
                {
                    this.state.arr.map((v, i) => {
                        return (
                            <div className="item" key={i}>
                                <img src={v.pic} alt="" />
                                <span>{v.name}</span>
                            </div>
                        )
                    })
                }
            </div>
        )
    }
}
